export const toBase64 = (file) => {
  let _this = this
  return new Promise(resolve => {
    uni.getFileSystemManager().readFile({
        filePath: file, //选择图片返回的相对路径
        encoding: 'base64', //编码格式
        success: res => {
            // 成功的回调
            let base64 = res;
            resolve(base64.data)
        }
    });
  })
}
export const fileBase64Size = (file) => {
  return new Promise(resolve => {
    toBase64(file).then(res => {
      resolve(res.length)
    })
  })
} 